const name = 'Snickers';
const age = 2;
// console.log('My dog ' + name + ' is ' + age + 'years old');
// 1.function sayMyDog(){}
// 2.const sayMyDog=function(){}
// 如果函数体只有一句代码，并且是返回值的话，连花括号也可以省掉

// const sayMyDog = (name, age) => { //箭头函数 不需要function 关键字
//     // es6 字符串模板
//     return `My dog ${name} is ${age} years old`;
//     // return 'My dog ' + name + ' is ' + age + ' years old';
// }
const sayMyDog = (name, age) => `My dog ${name} is ${age} years old`
console.log(sayMyDog(name, age));